package stu.sup.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import stu.sup.dto.MerProductDTO;
import stu.sup.dto.ProductDto;
import stu.sup.entity.Merchants;
import stu.sup.entity.MerchantsInfo;
import stu.sup.entity.MerchantsProduct;
import stu.sup.entity.Product;
import stu.sup.mapper.MerchantsProductMapper;
import stu.sup.service.IMerProductService;

import java.util.List;

/**
 * 本类用来演示：
 *
 * @author:Administrator
 * @data:2020/6/26 0026
 */
@Service
@Transactional
public class MerProductServiceImpl implements IMerProductService {
    @Autowired
    private MerchantsProductMapper merchantsProductMapper;

//    @Override
//    public List<Product> findALLProductByMerchantId(Merchants merchants) {
//        return merchantsProductMapper.findALLProductByMerchantId(merchants);
//    }

    @Override
    public List<MerProductDTO> findALLProductByMerchantId(Integer merchantsId) {
        return merchantsProductMapper.findALLProductByMerchantId(merchantsId);
    }

    @Override
    public MerchantsInfo findMerchantByProductId(Integer id) {
        return merchantsProductMapper.findMerchantByProductId(id);
    }

}
